package com.qinglei.recoup.system.controller;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.handler.annotation.DestinationVariable;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.messaging.simp.annotation.SubscribeMapping;
import org.springframework.stereotype.Controller;

/**
 * 直播课堂WebSocket接口
 */
@Slf4j
@Controller
@AllArgsConstructor
public class EventWsController {

    /**
     * 接收客户端订阅床位状态接口
     *
     * @param bedId 床位ID
     */
    @SubscribeMapping("/bedStatus.{bedId}")
    public void getBedStatus(@DestinationVariable Integer bedId) {
        log.info("getBedStatus receive message bedId:{}", bedId);
    }

    /**
     * 接收客户端订阅床位事件接口
     *
     * @param bedId 床位ID
     */
    @SubscribeMapping("/bedEvent.{bedId}")
    public void getBedEvent(@DestinationVariable Integer bedId) {
        log.info("getBedEvent receive message bedId:{}", bedId);
    }

    /**
     * 接收客户端订阅巡视事件接口
     *
     * @param tenantId 租户ID
     */
    @SubscribeMapping("/tourEvent.{tenantId}")
    public void getTourEvent(@DestinationVariable Integer tenantId) {
        log.info("getTourEvent receive message tenantId:{}", tenantId);
    }

    /**
     * 接收客户端订阅全院床位状态接口
     *
     * @param tenantId 租户ID
     */
    @SubscribeMapping("/allBedStatus.{tenantId}")
    public void getAllBedStatus(@DestinationVariable Integer tenantId) {
        log.info("getAllBedStatus receive message tenantId:{}", tenantId);
    }

    /**
     * 接收客户端订阅全院床位事件接口
     *
     * @param tenantId 租户ID
     */
    @SubscribeMapping("/allBedEvent.{tenantId}")
    public void getAllBedEvent(@DestinationVariable Integer tenantId) {
        log.info("getAllBedEvent receive message tenantId:{}", tenantId);
    }
}
